home *** CD-ROM | disk | FTP | other *** search
- Path: atglab.bls.com!phoenix!brent
- From: brent@phoenix.bss.com (Brent Paulson)
- Newsgroups: comp.lang.c++
- Subject: Template instatiation with Sun CC
- Date: 10 Apr 1996 17:07:34 GMT
- Organization: BellSouth Telecommunications
- Message-ID: <4kgpsm$7nt@atglab10.atglab.bls.com>
- NNTP-Posting-Host: bstfirewall.bst.bls.com
-
-
- I'm fairly new to C++, so don't beat me up too bad. I've spent a few days
- in the docs, including the Sun C++ docs, but no luck. I'll try to make this
- as clear and simple as possible.
-
- I'm writing a process in C++ with a Motif GUI. There are multiple directories,
- one exec, many archives. I have defined an object in a header file, and its
- functions in a .C file in the executable (linking) directory. A list of
- these instantiated objects is needed globally. The objects are always
- declared locally, and placed in a single instance of a collector class.
- This class is a template class from Rogue Wave's Tools.h++.
-
- In a testbed program, where the scope was one file, everything instantiated
- properly. No extern definitions were needed, as the collector was declared
- globally and was available to all routines.
-
- Moving everything to the development program, the problem is that every
- time the header file that contains the declaration is included in an object
- file, a new collector object is instantiated. (Appropriate wrappers used.)
- The Sun C++ compiler uses compile time instantiation of template classes.
-
- How do I make one instance of an object available among multiple
- directories, most of them archives?
-
-
- If you wish to reply by email, send to:
- Walt.Marchand@bridge.bst.bls.com
-
- Thanks in advance.
- Walt Marchand
- Contractor, BellSouth SNT
-
-